﻿using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Text;

namespace SaaS.Model.Dto.Auths
{
    public class OrganizationUnitChildren
    {
        public int Id { get; set; }
        public string Name { get; set; }
        private readonly List<OrganizationUnitChildren> _children;
        public IReadOnlyList<OrganizationUnitChildren> Children => _children.ToImmutableList();
        public OrganizationUnitChildren(int id,string name)
        {
            this.Id = id;
            this.Name = name;
            _children = new List<OrganizationUnitChildren>();
        }
        public OrganizationUnitChildren CreateChildrenOrganization(int id,string name)
        {
            var children = new OrganizationUnitChildren(id, name);
            _children.Add(children);
            return children;
        }
    }
}
